﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

using System.Reflection;
using System.Collections.Generic;
using System.Collections.ObjectModel;

namespace ColorUtilities
{
    public class NamedColors
    {

        private static string CleanGet(string psIn)
        {
            return psIn.Replace("get_", "");
        }

        public static Color GetColor(string psColorName)
        {
            psColorName = CleanGet(psColorName);
            String xamlString = string.Format
                ("<Canvas xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\" Background=\"{0}\"/>", psColorName);
            Canvas c = (Canvas)System.Windows.Markup.XamlReader.Load(xamlString);
            SolidColorBrush canvasBrush = (SolidColorBrush)c.Background;
            Color color = canvasBrush.Color;
            return color;
        }


        public static Color FromHex(string psHex)
        {
            psHex = psHex.Trim();
            if (!psHex.StartsWith("#"))
                psHex = "#" + psHex;

            if (psHex.Length > 7 && psHex.Length != 9)
                psHex = psHex.Substring(0, 7);
            else if (psHex.Length < 7)
            {
                string sMissing0s = new string('0', 7 - psHex.Length);
                psHex = "#" + sMissing0s + psHex.Substring(1);
            }

            return GetColor(psHex);
        }

        public static List<Color> NamedColorsList
        = new List<Color>()        {
         AliceBlue,
         AntiqueWhite,
         Aqua,
         Aquamarine,
         Azure,
         Beige,
         Bisque,
         Black,
         BlanchedAlmond,
         Blue,
         BlueViolet,
         Brown,
         BurlyWood,
         CadetBlue,
         Chartreuse,
         Chocolate,
         Coral,
         CornflowerBlue,
         Cornsilk,
         Crimson,
         Cyan,
         DarkBlue,
         DarkCyan,
         DarkGoldenrod,
         DarkGray,
         DarkGreen,
         DarkKhaki,
         DarkMagenta,
         DarkOliveGreen,
         DarkOrange,
         DarkOrchid,
         DarkRed,
         DarkSalmon,
         DarkSeaGreen,
         DarkSlateBlue,
         DarkSlateGray,
         DarkTurquoise,
         DarkViolet,
         DeepPink,
         DeepSkyBlue,
         DimGray,
         DodgerBlue,
         Firebrick,
         FloralWhite,
         ForestGreen,
         Fuchsia,
         Gainsboro,
         GhostWhite,
         Gold,
         Goldenrod,
         Gray,
         Green,
         GreenYellow,
         Honeydew,
         HotPink,
         IndianRed,
         Indigo,
         Ivory,
         Khaki,
         Lavender,
         LavenderBlush,
         LawnGreen,
         LemonChiffon,
         LightBlue,
         LightCoral,
         LightCyan,
         LightGoldenrodYellow,
         LightGray,
         LightGreen,
         LightPink,
         LightSalmon,
         LightSeaGreen,
         LightSkyBlue,
         LightSlateGray,
         LightSteelBlue,
         LightYellow,
         Lime,
         LimeGreen,
         Linen,
         Magenta,
         Maroon,
         MediumAquamarine,
         MediumBlue,
         MediumOrchid,
         MediumPurple,
         MediumSeaGreen,
         MediumSlateBlue,
         MediumSpringGreen,
         MediumTurquoise,
         MediumVioletRed,
         MidnightBlue,
         MintCream,
         MistyRose,
         Moccasin,
         NavajoWhite,
         Navy,
         OldLace,
         Olive,
         OliveDrab,
         Orange,
         OrangeRed,
         Orchid,
         PaleGoldenrod,
         PaleGreen,
         PaleTurquoise,
         PaleVioletRed,
         PapayaWhip,
         PeachPuff,
         Peru,
         Pink,
         Plum,
         PowderBlue,
         Purple,
         Red,
         RosyBrown,
         RoyalBlue,
         SaddleBrown,
         Salmon,
         SandyBrown,
         SeaGreen,
         SeaShell,
         Sienna,
         Silver,
         SkyBlue,
         SlateBlue,
         SlateGray,
         Snow,
         SpringGreen,
         SteelBlue,
         Tan,
         Teal,
         Thistle,
         Tomato,
         Transparent,
         Turquoise,
         Violet,
         Wheat,
         White,
         WhiteSmoke,
         Yellow,
         YellowGreen
        };

        public static List<String> NamedColorsNamesList  = new List<String>()        
        {
            "AliceBlue",
            "AntiqueWhite",
            "Aqua",
            "Aquamarine",
            "Azure",
            "Beige",
            "Bisque",
            "Black",
            "BlanchedAlmond",
            "Blue",
            "BlueViolet",
            "Brown",
            "BurlyWood",
            "CadetBlue",
            "Chartreuse",
            "Chocolate",
            "Coral",
            "CornflowerBlue",
            "Cornsilk",
            "Crimson",
            "Cyan",
            "DarkBlue",
            "DarkCyan",
            "DarkGoldenrod",
            "DarkGray",
            "DarkGreen",
            "DarkKhaki",
            "DarkMagenta",
            "DarkOliveGreen",
            "DarkOrange",
            "DarkOrchid",
            "DarkRed",
            "DarkSalmon",
            "DarkSeaGreen",
            "DarkSlateBlue",
            "DarkSlateGray",
            "DarkTurquoise",
            "DarkViolet",
            "DeepPink",
            "DeepSkyBlue",
            "DimGray",
            "DodgerBlue",
            "Firebrick",
            "FloralWhite",
            "ForestGreen",
            "Fuchsia",
            "Gainsboro",
            "GhostWhite",
            "Gold",
            "Goldenrod",
            "Gray",
            "Green",
            "GreenYellow",
            "Honeydew",
            "HotPink",
            "IndianRed",
            "Indigo",
            "Ivory",
            "Khaki",
            "Lavender",
            "LavenderBlush",
            "LawnGreen",
            "LemonChiffon",
            "LightBlue",
            "LightCoral",
            "LightCyan",
            "LightGoldenrodYellow",
            "LightGray",
            "LightGreen",
            "LightPink",
            "LightSalmon",
            "LightSeaGreen",
            "LightSkyBlue",
            "LightSlateGray",
            "LightSteelBlue",
            "LightYellow",
            "Lime",
            "LimeGreen",
            "Linen",
            "Magenta",
            "Maroon",
            "MediumAquamarine",
            "MediumBlue",
            "MediumOrchid",
            "MediumPurple",
            "MediumSeaGreen",
            "MediumSlateBlue",
            "MediumSpringGreen",
            "MediumTurquoise",
            "MediumVioletRed",
            "MidnightBlue",
            "MintCream",
            "MistyRose",
            "Moccasin",
            "NavajoWhite",
            "Navy",
            "OldLace",
            "Olive",
            "OliveDrab",
            "Orange",
            "OrangeRed",
            "Orchid",
            "PaleGoldenrod",
            "PaleGreen",
            "PaleTurquoise",
            "PaleVioletRed",
            "PapayaWhip",
            "PeachPuff",
            "Peru",
            "Pink",
            "Plum",
            "PowderBlue",
            "Purple",
            "Red",
            "RosyBrown",
            "RoyalBlue",
            "SaddleBrown",
            "Salmon",
            "SandyBrown",
            "SeaGreen",
            "SeaShell",
            "Sienna",
            "Silver",
            "SkyBlue",
            "SlateBlue",
            "SlateGray",
            "Snow",
            "SpringGreen",
            "SteelBlue",
            "Tan",
            "Teal",
            "Thistle",
            "Tomato",
            "Transparent",
            "Turquoise",
            "Violet",
            "Wheat",
            "White",
            "WhiteSmoke",
            "Yellow",
            "YellowGreen"

        };

        public static Color AliceBlue { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color AntiqueWhite { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color Aqua { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color Aquamarine { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color Azure { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color Beige { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color Bisque { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color Black { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color BlanchedAlmond { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color Blue { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color BlueViolet { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color Brown { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color BurlyWood { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color CadetBlue { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color Chartreuse { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color Chocolate { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color Coral { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color CornflowerBlue { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color Cornsilk { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color Crimson { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color Cyan { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color DarkBlue { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color DarkCyan { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color DarkGoldenrod { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color DarkGray { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color DarkGreen { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color DarkKhaki { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color DarkMagenta { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color DarkOliveGreen { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color DarkOrange { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color DarkOrchid { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color DarkRed { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color DarkSalmon { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color DarkSeaGreen { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color DarkSlateBlue { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color DarkSlateGray { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color DarkTurquoise { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color DarkViolet { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color DeepPink { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color DeepSkyBlue { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color DimGray { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color DodgerBlue { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color Firebrick { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color FloralWhite { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color ForestGreen { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color Fuchsia { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color Gainsboro { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color GhostWhite { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color Gold { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color Goldenrod { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color Gray { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color Green { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color GreenYellow { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color Honeydew { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color HotPink { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color IndianRed { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color Indigo { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color Ivory { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color Khaki { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color Lavender { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color LavenderBlush { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color LawnGreen { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color LemonChiffon { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color LightBlue { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color LightCoral { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color LightCyan { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color LightGoldenrodYellow { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color LightGray { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color LightGreen { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color LightPink { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color LightSalmon { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color LightSeaGreen { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color LightSkyBlue { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color LightSlateGray { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color LightSteelBlue { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color LightYellow { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color Lime { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color LimeGreen { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color Linen { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color Magenta { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color Maroon { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color MediumAquamarine { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color MediumBlue { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color MediumOrchid { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color MediumPurple { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color MediumSeaGreen { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color MediumSlateBlue { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color MediumSpringGreen { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color MediumTurquoise { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color MediumVioletRed { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color MidnightBlue { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color MintCream { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color MistyRose { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color Moccasin { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color NavajoWhite { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color Navy { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color OldLace { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color Olive { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color OliveDrab { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color Orange { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color OrangeRed { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color Orchid { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color PaleGoldenrod { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color PaleGreen { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color PaleTurquoise { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color PaleVioletRed { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color PapayaWhip { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color PeachPuff { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color Peru { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color Pink { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color Plum { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color PowderBlue { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color Purple { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color Red { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color RosyBrown { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color RoyalBlue { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color SaddleBrown { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color Salmon { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color SandyBrown { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color SeaGreen { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color SeaShell { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color Sienna { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color Silver { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color SkyBlue { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color SlateBlue { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color SlateGray { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color Snow { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color SpringGreen { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color SteelBlue { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color Tan { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color Teal { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color Thistle { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color Tomato { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color Transparent { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color Turquoise { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color Violet { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color Wheat { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color White { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color WhiteSmoke { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color Yellow { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }
        public static Color YellowGreen { get { return GetColor(MethodBase.GetCurrentMethod().Name.Substring(4)); } }

    }

    public class ColorLegend
    {
        public string ColorName { get; set; }
        public Color ColorValue { get; set; }

        public ColorLegend(string psName, Color pColor)
        {
            this.ColorName = psName;
            this.ColorValue = pColor;
        }
    }

    public class NamedColorsLegendsList : ObservableCollection<ColorLegend>
    {
        public NamedColorsLegendsList()
        {
            int i = 0;
            foreach (Color c in NamedColors.NamedColorsList)
            {
                this.Add(new ColorLegend(NamedColors.NamedColorsNamesList[i++], c));
            }   
        }
    }

}

